/* ==================================================================   
 * Created [2009-4-27 下午11:32:55] by Jon.King 
 * ==================================================================  
 * TSS 
 * ================================================================== 
 * mailTo:jinpujun@hotmail.com
 * Copyright (c) Jon.King, 2009-2012 
 * ================================================================== 
 */

package com.jinhe.tss.core.sso.identifier;

import com.jinhe.tss.core.exception.UserIdentificationException;
import com.jinhe.tss.core.sso.AnonymousOperator;
import com.jinhe.tss.core.sso.IOperator;
import com.jinhe.tss.core.sso.context.Context;


/**
 * <p> AnonymousUserIdentifier.java </p>
 * <p>
 * 匿名用户身份认证器
 * </p>
 */
public class AnonymousUserIdentifier extends BaseUserIdentifier {

    protected IOperator validate() throws UserIdentificationException {
        if (Context.getRequestContext().canAnonymous()) {
            return AnonymousOperator.anonymous; 
        } 
        else {
            throw new UserIdentificationException("系统要求身份认证，请重新登录！");
        }
    }

}
